<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Board Game Software: Board.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Board Game Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">A board game interface w/ 2 game implementations</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Board.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef BOARD_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define BOARD_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;utility&gt;</span>
<a name="l00006"></a>00006 
<a name="l00010"></a><a class="code" href="struct_point.html">00010</a> <span class="keyword">struct </span><a class="code" href="struct_point.html">Point</a>
<a name="l00011"></a>00011 {
<a name="l00012"></a>00012     <a class="code" href="struct_point.html">Point</a>() : x(0), y(0)
<a name="l00013"></a>00013      {}
<a name="l00014"></a>00014     <a class="code" href="struct_point.html">Point</a>(<span class="keywordtype">int</span> ix, <span class="keywordtype">int</span> iy ) :x(ix), y(iy) {}
<a name="l00015"></a>00015 
<a name="l00016"></a>00016     <span class="keywordtype">int</span> x;
<a name="l00017"></a>00017     <span class="keywordtype">int</span> y;
<a name="l00018"></a>00018 };
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="comment">/*struct Player</span>
<a name="l00021"></a>00021 <span class="comment">{</span>
<a name="l00022"></a>00022 <span class="comment">    Player(int n, char m) : number(n), mark(m) { }</span>
<a name="l00023"></a>00023 <span class="comment"></span>
<a name="l00024"></a>00024 <span class="comment">    int number;</span>
<a name="l00025"></a>00025 <span class="comment">    char mark;</span>
<a name="l00026"></a>00026 <span class="comment">};*/</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="keyword">typedef</span> std::vector&lt;std::vector&lt;char&gt; &gt; State; 
<a name="l00029"></a>00029 <span class="keyword">typedef</span> std::pair&lt;Point,std::vector&lt;Point&gt; &gt; MyPair; 
<a name="l00032"></a><a class="code" href="class_board.html">00032</a> <span class="keyword">class </span><a class="code" href="class_board.html">Board</a>
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034     <span class="keyword">public</span>:
<a name="l00035"></a>00035         <a class="code" href="class_board.html#a9ee491d4fea680cf69b033374a9fdfcb">Board</a>(); 
<a name="l00041"></a>00041         <a class="code" href="class_board.html#a9ee491d4fea680cf69b033374a9fdfcb">Board</a>(<span class="keywordtype">int</span> row, <span class="keywordtype">int</span> col);
<a name="l00042"></a>00042         <span class="keyword">virtual</span> <a class="code" href="class_board.html#af73f45730119a1fd8f6670f53f959e68">~Board</a>(); 
<a name="l00043"></a>00043         <a class="code" href="class_board.html#a9ee491d4fea680cf69b033374a9fdfcb">Board</a>(<span class="keyword">const</span> <a class="code" href="class_board.html">Board</a>&amp; other); 
<a name="l00044"></a>00044         <a class="code" href="class_board.html">Board</a>&amp; <a class="code" href="class_board.html#ae6c8d66af1bb70e1d34a704321675975">operator=</a>(<span class="keyword">const</span> <a class="code" href="class_board.html">Board</a>&amp; other); 
<a name="l00045"></a>00045         State <a class="code" href="class_board.html#a6620ebd560ccf49f4023902f87c22149">getBoard</a>() <span class="keyword">const</span>; 
<a name="l00046"></a>00046         <span class="keywordtype">void</span> <a class="code" href="class_board.html#a8bd19a32d48ecb8c7736d3caed0175e1">setBoard</a>(State newBoard); 
<a name="l00047"></a>00047         <span class="keywordtype">void</span> <a class="code" href="class_board.html#aca49f093314a104381d05998bbf62f7f">printBoard</a>(); 
<a name="l00054"></a>00054         <span class="keywordtype">void</span> <a class="code" href="class_board.html#a6d361394de09ecac862f6e1a4ee736f3">movePlayer</a>(<span class="keywordtype">int</span> player, <a class="code" href="struct_point.html">Point</a> from, <a class="code" href="struct_point.html">Point</a> to);
<a name="l00059"></a>00059         <span class="keywordtype">bool</span> <a class="code" href="class_board.html#a1ec07dcac70b8cf8b38f6567bbb0633a">isOccupied</a> (<a class="code" href="struct_point.html">Point</a> point);
<a name="l00065"></a>00065         std::vector&lt;char&gt; <a class="code" href="class_board.html#a2ddb59ae448c0827f0c36c4e3278bef5">getRow</a>(<span class="keywordtype">int</span> player);
<a name="l00071"></a>00071         std::vector&lt;Point&gt; <a class="code" href="class_board.html#ac4ca39c0e15da6e7f2abb843727f3cac">arrayOfPoints</a>(<span class="keywordtype">int</span> player);
<a name="l00072"></a>00072         <span class="keywordtype">void</span> <a class="code" href="class_board.html#a67cf113c045c8aec1565f48eef8e5770">initBoard</a>(); 
<a name="l00073"></a>00073         <span class="keywordtype">int</span> <a class="code" href="class_board.html#a4b3af55a955cb9d6b86c89ddf729cbb9">getPieceRows</a>() <span class="keyword">const</span>; 
<a name="l00074"></a>00074         <span class="keywordtype">void</span> <a class="code" href="class_board.html#a0a34732d8ea728be0e39e0712bcc7f08">setPieceRows</a>(<span class="keywordtype">int</span> n); 
<a name="l00075"></a>00075         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_board.html#ab7ac620132ba55e6fc5cbee2cac5dbea">getRows</a>() <span class="keyword">const</span>; 
<a name="l00076"></a>00076         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_board.html#a169f719f01519b51ff615a8b0dad0309">getCol</a>() <span class="keyword">const</span>; 
<a name="l00077"></a>00077         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_board.html#a835d87a63eab1ecf2af1e91818403f5d">getPieces</a>(<span class="keywordtype">int</span> player) <span class="keyword">const</span>; 
<a name="l00078"></a>00078     <span class="keyword">private</span>:
<a name="l00079"></a>00079         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_row; 
<a name="l00080"></a>00080         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_col; 
<a name="l00081"></a>00081         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_piece_rows; 
<a name="l00082"></a>00082         State m_gameBoard; 
<a name="l00083"></a>00083 };
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="preprocessor">#endif // BOARD_H</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Sat May 12 2012 04:42:38 for Board Game Software by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
